package controllers

import (
	"fmt"
	"github.com/astaxie/beego"
)

type MainController struct {
	beego.Controller
}

func (c *MainController) Get() {
	initFile := ".\\models\\data\\initFile.json"
	xxxMap, err := ReadFile(initFile)
	if err != nil {
		fmt.Println("readFile: ", err.Error())
		return
	}

	if len(xxxMap) == 0 {
		c.Data["start"] = true
	} else {
		c.Data["start"] = false
		c.Data["Num"] = len(xxxMap)
		c.Data["UserLogo"] = xxxMap
	}
	c.Data["Website"] = "beego.me"
	c.Data["Email"] = "astaxie@gmail.com"
	//
	c.TplName = "index.html"
}
